package com.bearhy.jqadmin.service;

import com.bearhy.jqadmin.mapper.SysRoleMapper;
import com.bearhy.jqadmin.model.SysRole;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysRoleService {

    @Autowired
    private SysRoleMapper sysRoleMapper;

    /**
     * 根据用户的角色id获取角色列表
     * @param roleIds 角色id字符串
     * @return 角色列表
     */
    public List<SysRole> getRoleListByUserRoldIds(String roleIds){
        String[] ids = roleIds.split(",");
        List<SysRole> roleList = sysRoleMapper.selectByIds(ids);
        return roleList;
    }
}
